package kr.hkit.powerjava.chapter14.submit;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import java.awt.FlowLayout;

public class InsertPanel extends JPanel {
	private JTextField insertText;
	private JLabel lblNewLabel;

	/**
	 * Create the panel.
	 */
	public InsertPanel(String text) {

		initialize(text);
	}
	private void initialize(String text) {
		setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		
		lblNewLabel = new JLabel(text);
		add(lblNewLabel);
		
		insertText = new JTextField();
		add(insertText);
		insertText.setColumns(5);
	}

	public String getInsertText() {
		return insertText.getText();
	}

	public void setInsertText(String text) {
		insertText.setText(text);
	}
}
